package ch.ti.bfh.app.loodel.internal;

import ch.ti.bfh.app.loodel.domain.learningEvent.LearningEvent;
import ch.ti.bfh.app.loodel.service.vote.LearningEventVoteData;

public class LearningEventAssembler {

    public static LearningEventVoteData getLearningEventVoteData(LearningEvent learningEvent, int numberOfDifferentVoters) {
        LearningEventVoteData learningEventVoteData = new LearningEventVoteData();
        learningEventVoteData.setModul(learningEvent.getModulName());
        learningEventVoteData.setGroupName(learningEvent.getGroupName());
        learningEventVoteData.setDescription(learningEvent.getDescription());
        learningEventVoteData.setLearningEventId(learningEvent.getId());
        learningEventVoteData.setOwner(MemberAssembler.getMemberData(learningEvent.getOwner()));
        learningEventVoteData.setNumberOfPossibleTimeSlots(learningEvent.getTimeSlots().size());
        learningEventVoteData.setCreateTime(learningEvent.getCreateTime());
        learningEventVoteData.setVotesClosed(learningEvent.getVotesClosed());
        learningEventVoteData.setNumberOfVoters(numberOfDifferentVoters);
        return learningEventVoteData;
    }
}